package com.idata.model.dto;

import com.idata.model.enums.GraphAnalysisNodeTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class KGGraphExploreNodeDTO {

    private String content;

    private String id;

    private String avatarUrl;

    private int type;

    private List<String> relationList = new ArrayList<>();

    public String getTypeName() {
        return GraphAnalysisNodeTypeEnum.getDescFromCode(type);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        KGGraphExploreNodeDTO that = (KGGraphExploreNodeDTO) o;
        return Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
